package com.servicebuck.database.entity;
// Generated Aug 30, 2011 11:09:02 PM by Hibernate Tools 3.4.0.CR1


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Identity generated by hbm2java
 */
@Entity
@Table(name="identity"
    ,catalog="telluricng"
)
public class Identity  implements java.io.Serializable {


     private long identityId;
     private Integer firstName;
     private int lastName;
     private String middleName;
     private String email;
     private String telephone;
     private String fax;
     private String alternateEmail;
     private String supervisor;
     private String identifier;
     private Integer socialnetworkingenabled;
     private Integer inactive;
     private Set<Domain> domains = new HashSet<Domain>(0);
     private Set<User> users = new HashSet<User>(0);

    public Identity() {
    }

	
    public Identity(long identityId, int lastName, String identifier) {
        this.identityId = identityId;
        this.lastName = lastName;
        this.identifier = identifier;
    }
    public Identity(long identityId, Integer firstName, int lastName, String middleName, String email, String telephone, String fax, String alternateEmail, String supervisor, String identifier, Integer socialnetworkingenabled, Integer inactive, Set<Domain> domains, Set<User> users) {
       this.identityId = identityId;
       this.firstName = firstName;
       this.lastName = lastName;
       this.middleName = middleName;
       this.email = email;
       this.telephone = telephone;
       this.fax = fax;
       this.alternateEmail = alternateEmail;
       this.supervisor = supervisor;
       this.identifier = identifier;
       this.socialnetworkingenabled = socialnetworkingenabled;
       this.inactive = inactive;
       this.domains = domains;
       this.users = users;
    }
   
     @Id 

    
    @Column(name="identity_id", unique=true, nullable=false)
    public long getIdentityId() {
        return this.identityId;
    }
    
    public void setIdentityId(long identityId) {
        this.identityId = identityId;
    }

    
    @Column(name="first_name")
    public Integer getFirstName() {
        return this.firstName;
    }
    
    public void setFirstName(Integer firstName) {
        this.firstName = firstName;
    }

    
    @Column(name="last_name", nullable=false)
    public int getLastName() {
        return this.lastName;
    }
    
    public void setLastName(int lastName) {
        this.lastName = lastName;
    }

    
    @Column(name="middle_name", length=55)
    public String getMiddleName() {
        return this.middleName;
    }
    
    public void setMiddleName(String middleName) {
        this.middleName = middleName;
    }

    
    @Column(name="email")
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }

    
    @Column(name="telephone", length=45)
    public String getTelephone() {
        return this.telephone;
    }
    
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    
    @Column(name="fax", length=45)
    public String getFax() {
        return this.fax;
    }
    
    public void setFax(String fax) {
        this.fax = fax;
    }

    
    @Column(name="alternate_email")
    public String getAlternateEmail() {
        return this.alternateEmail;
    }
    
    public void setAlternateEmail(String alternateEmail) {
        this.alternateEmail = alternateEmail;
    }

    
    @Column(name="supervisor", length=100)
    public String getSupervisor() {
        return this.supervisor;
    }
    
    public void setSupervisor(String supervisor) {
        this.supervisor = supervisor;
    }

    
    @Column(name="identifier", nullable=false, length=55)
    @GeneratedValue(strategy=GenerationType.AUTO)
    public String getIdentifier() {
        return this.identifier;
    }
    
    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    
    @Column(name="socialnetworkingenabled")
    public Integer getSocialnetworkingenabled() {
        return this.socialnetworkingenabled;
    }
    
    public void setSocialnetworkingenabled(Integer socialnetworkingenabled) {
        this.socialnetworkingenabled = socialnetworkingenabled;
    }

    
    @Column(name="inactive")
    public Integer getInactive() {
        return this.inactive;
    }
    
    public void setInactive(Integer inactive) {
        this.inactive = inactive;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="identitydomainbridge", catalog="telluricng", joinColumns = { 
        @JoinColumn(name="identity_id", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="domain_id", nullable=false, updatable=false) })
    public Set<Domain> getDomains() {
        return this.domains;
    }
    
    public void setDomains(Set<Domain> domains) {
        this.domains = domains;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="identity")
    public Set<User> getUsers() {
        return this.users;
    }
    
    public void setUsers(Set<User> users) {
        this.users = users;
    }




}


